package com.winit.openapi.oauth.manager;

import java.util.List;

import com.winit.common.query.Page;
import com.winit.openapi.oauth.command.QueryUserAuthInfoByUserCommand;
import com.winit.openapi.oauth.command.QueryUserAuthInfoByClientCommand;
import com.winit.openapi.oauth.vo.UserAuthorizationVo;

public interface UserAuthorizationManager {

    void insertOrUpdate(UserAuthorizationVo vo);

    List<UserAuthorizationVo> queryByClientId(Long clientId);
    
    Page<UserAuthorizationVo> findPageByUserId(QueryUserAuthInfoByUserCommand command);
    
    Page<UserAuthorizationVo> findPageByClientId(QueryUserAuthInfoByClientCommand command);
    
    int getUserCountByClient(Long clientId);
    
    void unbind(Long clientId,Long userId);
    
    UserAuthorizationVo queryByClientAndUser(Long clientId,Long userId);
    
    UserAuthorizationVo queryByClientAndUserName(Long clientId,String userName);
    
    UserAuthorizationVo queryByClientKeyAndUserName(String clientKey,String userName);


}
